﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using vITs.Site.Models.DataModels;

namespace vITs.Site.Controllers
{
    public class DashboardController : Controller
    {
        public ActionResult Index()
        {
            VitsDB db = new VitsDB();

            User user = db.Users.SingleOrDefault(u => u.EmailAddress == this.User.Identity.Name);
            var assignments = db.Assignments.Where(a => a.HandlerId == user.UserId && a.Status == 1);

            ViewBag.AssignmentList = assignments;

            return View();
        }

    }
}
